package page345;

import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.RandomAccess;

public class Test1 {
    public static void main(String[] args) {
        try (RandomAccessFile inAndOut = new RandomAccessFile("test.txt", "rw");) {
            for (long i = inAndOut.length() - 1; i >= 0; i--) {
                inAndOut.seek(i);
                System.out.printf("%c", (char) inAndOut.readByte());
            }
        } catch (IOException e) {
            e.fillInStackTrace();
        }
    }
}
